// @ts-ignore
/* eslint-disable */
import { request } from "@/utils/request";

/** 获取应用配置列表 获取应用配置列表，支持分页和筛选 GET /admin/app-configs */
export async function adminAppConfigs(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.AdminAppConfigsParams,
  options?: { [key: string]: any }
) {
  return request<API.PageResponse & { data?: API.AppConfigResponse[] }>(
    `/admin/app-configs`,
    {
      method: "GET",
      params: {
        // page has a default value: 1
        page: "1",
        // page_size has a default value: 10
        page_size: "10",

        ...params,
      },
      ...(options || {}),
    }
  );
}

/** 创建应用配置 创建新的应用配置 POST /admin/app-configs */
export async function adminAppConfigs2(
  body: API.AppConfigCreateRequest,
  options?: { [key: string]: any }
) {
  return request<API.Response & { data?: API.AppConfigResponse }>(
    `/admin/app-configs`,
    {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
      },
      data: body,
      ...(options || {}),
    }
  );
}

/** 获取应用配置详情 根据ID获取应用配置详情 GET /admin/app-configs/${param0} */
export async function adminAppConfigsId(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.AdminAppConfigsIdParams,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params;
  return request<API.Response & { data?: API.AppConfigResponse }>(
    `/admin/app-configs/${param0}`,
    {
      method: "GET",
      params: { ...queryParams },
      ...(options || {}),
    }
  );
}

/** 更新应用配置 更新应用配置信息 PUT /admin/app-configs/${param0} */
export async function adminAppConfigsId2(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.AdminAppConfigsIdParams,
  body: API.AppConfigUpdateRequest,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params;
  return request<API.Response & { data?: API.AppConfigResponse }>(
    `/admin/app-configs/${param0}`,
    {
      method: "PUT",
      headers: {
        "Content-Type": "application/json",
      },
      params: { ...queryParams },
      data: body,
      ...(options || {}),
    }
  );
}

/** 删除应用配置 删除应用配置 DELETE /admin/app-configs/${param0} */
export async function adminAppConfigsId3(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.AdminAppConfigsIdParams,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params;
  return request<any>(`/admin/app-configs/${param0}`, {
    method: "DELETE",
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 根据配置键获取应用配置 根据配置键获取应用配置详情 GET /admin/app-configs/key/${param0} */
export async function adminAppConfigsKeyKey(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.AdminAppConfigsKeyKeyParams,
  options?: { [key: string]: any }
) {
  const { key: param0, ...queryParams } = params;
  return request<API.Response & { data?: API.AppConfigResponse }>(
    `/admin/app-configs/key/${param0}`,
    {
      method: "GET",
      params: { ...queryParams },
      ...(options || {}),
    }
  );
}

/** 根据配置键更新配置值 根据配置键更新配置值 PUT /admin/app-configs/key/${param0} */
export async function adminAppConfigsKeyKey2(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.AdminAppConfigsKeyKeyParams,
  body: Record<string, any>,
  options?: { [key: string]: any }
) {
  const { key: param0, ...queryParams } = params;
  return request<API.Response & { data?: API.AppConfigResponse }>(
    `/admin/app-configs/key/${param0}`,
    {
      method: "PUT",
      headers: {
        "Content-Type": "application/json",
      },
      params: { ...queryParams },
      data: body,
      ...(options || {}),
    }
  );
}

/** 获取系统配置 获取所有系统配置 GET /admin/app-configs/system */
export async function adminAppConfigsSystem(options?: { [key: string]: any }) {
  return request<API.Response & { data?: API.AppConfigResponse[] }>(
    `/admin/app-configs/system`,
    {
      method: "GET",
      ...(options || {}),
    }
  );
}

/** 获取用户配置 获取所有用户配置 GET /admin/app-configs/user */
export async function adminAppConfigsUser(options?: { [key: string]: any }) {
  return request<API.Response & { data?: API.AppConfigResponse[] }>(
    `/admin/app-configs/user`,
    {
      method: "GET",
      ...(options || {}),
    }
  );
}
